﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<timetableasy.Models.RegisterModel>" %>

<asp:Content ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        function redirect(dropDownValue) {
            window.location.href = '/Account/RegisterBis?role=' + dropDownValue;
        }
    </script>
</asp:Content>
<asp:Content ID="registerTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Register
</asp:Content>
<asp:Content ID="registerContent" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server">
    <h2>
        Create a New Account</h2>
    
    <% using (Html.BeginForm())
       { %>
    
    <div>
        <fieldset>
            <legend>Account Information</legend>
            <div class="editor-field">
                <%-- <%= Html.DropDownList(
                        "RoleName", 
                        ViewData["Roles"] as SelectList, 
                        "--Select One--", 
                        new{
                              onchange = "document.getElementById('Form').submit();"
                           })%>--%>
                <%: Html.DropDownList("RoleName", ViewData["Roles"] as SelectList, new { onchange = "redirect(this.value)" })%>
            </div>
            
        </fieldset>
    </div>
    <% } %>
    </form>
</asp:Content>
